package peerToPeerFacebook.proj;

public class FileServerCommand implements IFileServerCommand 
{
	private String commandName;
	private int serverID;
	private String fileName;
	private String contents;
	
	public FileServerCommand(String commandName, int serverID, String fileName)
	{
		// call main constructor with default value of rest of parameters
		this(commandName, serverID, fileName, null);
	}
	
	public FileServerCommand(String commandName, int serverID, String fileName, String contents)
	{
		ArgumentValidator.IsNotNullOrEmpty("commandName", commandName);
		ArgumentValidator.IsGreaterThanOrEqualTo("serverID", serverID, 0);
		ArgumentValidator.IsNotNullOrEmpty("fileName", fileName);		
		// contents is optional depending on the command and can be null
		
		this.commandName = commandName;
		this.serverID = serverID;
		this.fileName = fileName;
		this.contents = contents;
	}
	
	public String commandName() 
	{
		return this.commandName;		
	}
	
	public int serverID() 
	{
		return this.serverID;		
	}
	
	public String fileName()
	{
		return this.fileName;
	}
	
	public String contents()
	{
		return this.contents;
	}
}
